<template>
<div>
	测试我的页面。
  	<div v-if="userdata.level == 0">
  		<membercenter></membercenter>
  	</div>

  	<div v-if="userdata.level != 0">
  		<sellercenter></sellercenter>
  	</div>
</div>
</template>

<script>

import { Cell, Button, Badge, MessageBox} from 'mint-ui'
import { mapGetters } from 'vuex'

import sellercenter from '../mine/sellercenter'
import membercenter from '../mine/membercenter'

export default {
	name: 'toolmine',
	data () {
		return {
			msg: '我的。。。。。。'
		}
	},

	computed : {
		...mapGetters([
			'company_code',
			'userdata',
		]),
	},


	components: {
		sellercenter,
		membercenter,
	},

	methods : {
		
	},

	mounted () {

		const currURL = window.location.href;

		const para = {
			fun : 'checkneedauthtest',
			requestType : 'get',
			cb : res => {
				console.log(res);
				if(res == '66'){
					this.$dialog.alert({'mes' : '不需要授权'});
					//支付授权
                    
				}else if(res == '2'){
					this.$dialog.alert({'mes' : '没有公众号'});
				}else if(res == '154'){	// == 1 // 需要授权

	window.location.href = 'https://api.hidlq.com/v1/un/authtest?company_code=' + 
    this.company_code + '&rurl='+ encodeURIComponent(currURL);


				}else{
					this.$dialog.alert({'mes' : res});
				}

			}
		};

		this.$store.dispatch('update', para);

	},

}
</script>

<style scoped>

</style>
